<template>
    <van-nav-bar title="首页" />

    <van-tabs v-model:active="active" animated>
        <van-tab title="推荐">

            <van-search v-model="value" show-action label="地址" placeholder="请输入搜索关键词" @search="onSearch">
                <template #action>
                    <div @click="onClickButton">搜索</div>
                </template>
            </van-search>

            <van-swipe :autoplay="3000" lazy-render>
                <van-swipe-item v-for="image in images" :key="image">
                    <img :src="image" style="width: 100%; height: 200px;" />
                </van-swipe-item>
            </van-swipe>

            <van-grid>
                <van-grid-item text="全球直采" />
                <van-grid-item text="正品保障" />
                <van-grid-item text="售后无忧" />
                <van-grid-item text="假一赔十" />
            </van-grid>

            <div>
                <p>限时购 <span style="width: 30px;height: 30px; background: black; color: white;">35</span> :
                    <span style="width: 30px;height: 30px; background: black; color: white;">19</span> :
                    <span style="width: 30px;height: 30px; background: black; color: white;">55</span> 每天10点 限时限量
                </p>
            </div>

            <van-grid>
                <van-grid-item icon="photo-o" text="￥8.88" />
                <van-grid-item icon="photo-o" text="￥8.88" />
                <van-grid-item icon="photo-o" text="￥8.88" />
                <van-grid-item icon="photo-o" text="￥8.88" />
            </van-grid>

            <div><img src="../../images/1.png" alt="" style="width: 100%;"></div>
        </van-tab>
        <van-tab title="美食">内容 2</van-tab>
        <van-tab title="运动">内容 3</van-tab>
        <van-tab title="保健品">内容 4</van-tab>
        <van-tab title="内衣">内容 5</van-tab>
        <van-tab title="更多">内容 6</van-tab>
    </van-tabs>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
];
</script>

<style lang="scss" scoped></style>